/* 显示星期数

编写一个函数 getWeekDay(date) 以短格式来显示一个日期的星期数：‘MO’，‘TU’，‘WE’，‘TH’，‘FR’，‘SA’，‘SU’ */

const getWeekDay = (date) => {
  switch (date.getDay()) {
    case 0:
      return "星期日";
    case 1:
      return "星期一";
    case 2:
      return "星期二";
    case 3:
      return "星期三";
    case 4:
      return "星期四";
    case 5:
      return "星期五";
    case 6:
      return "星期六";
  }
};

let date = new Date(2020, 4, 17);

console.log(`今天是${getWeekDay(date)}`);
